package com.example.listener;

import com.example.event.GenericEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class ConditionalEventListener {

    @EventListener(condition = "#event.content.startsWith('important')")
    public void handleEvent(GenericEvent<String> event) {
        System.out.println("Received conditional event important - " + event.getContent());
    }
}